package com.shrct.businessprocess.customerservice.events;

import com.shrct.businessprocess.customerservice.RCRequireStatus;
import com.shrct.businessprocess.customerservice.RCServiceContractDelegate;
import com.shrct.businessprocess.customerservice.events.RCServiceContractDelegateEventsListener;
import edu.fudan.mylang.pf.event.EntityEventsManager;
import java.util.Collection;
import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("com.shrct.businessprocess.customerservice.events.RCServiceContractDelegateEventsManager")
public class RCServiceContractDelegateEventsManager extends EntityEventsManager<RCServiceContractDelegate> {
  @Autowired(required = false)
  private Collection<RCServiceContractDelegateEventsListener> listeners = com.google.common.collect.Lists.newArrayList();;
  
  protected Collection<RCServiceContractDelegateEventsListener> getListeners() {
    return listeners;
  }
  
  public void fireUpdate(final RCServiceContractDelegate entity, final Procedure1<? super RCServiceContractDelegate> preInit) {
    for (edu.fudan.mylang.pf.event.IEntityEventsListner<?> listener : listeners) {
    	((RCServiceContractDelegateEventsListener)listener).update(entity,preInit);
    }
    
  }
  
  public void fireSetInstallRequirement(final RCServiceContractDelegate entity, final RCRequireStatus req) {
    for (edu.fudan.mylang.pf.event.IEntityEventsListner<?> listener : listeners) {
    	((RCServiceContractDelegateEventsListener)listener).setInstallRequirement(entity,req);
    }
    
  }
  
  public void fireSetRoutineServiceRequirement(final RCServiceContractDelegate entity, final RCRequireStatus req) {
    for (edu.fudan.mylang.pf.event.IEntityEventsListner<?> listener : listeners) {
    	((RCServiceContractDelegateEventsListener)listener).setRoutineServiceRequirement(entity,req);
    }
    
  }
}
